<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
        <title>浮动定位</title>
        <style>
            body > div {
                width: 200px;
                background-color: yellow;
                /* 当元素的所有子元素全部浮动时,自动识别的调度为0,后面的元素会顶上来导致显示异常,添加voerflow:hidden解决此异常 */
                overflow: hidden;
            }
            #d1 {
                width: 50px;
                height: 50px;
                background-color: blue;
                float: left;
            }
            #d2 {
                width: 50px;
                height: 50px;
                float: left;
                background-color: purple;
            }
            #d3 {
                width: 50px;
                height: 50px;
                float: left;
                background-color: green;
            }
        </style>
    </head>
    <body>
        <div>
            <div id="d1">div1</div>
            <div id="d2">div2</div>
            <div id="d3">div3</div>
        </div>
    </body>
</html>
